Skip to content

Clarify dollar_ticks example and FormatStrFormatter docs.#27601

Merged
story645 merged 1 commit intomatplotlib:mainfrom
anntzer:dt
Jan 5, 2024
Merged

Clarify dollar_ticks example and FormatStrFormatter docs.#27601
story645 merged 1 commit intomatplotlib:mainfrom
anntzer:dt

Conversation

@anntzer
Copy link
Copy Markdown
Contributor

@anntzer anntzer commented Jan 5, 2024

dollar_ticks only uses FormatStrFormatter implicitly.

Closes #25967.

PR summary

PR checklist

"${x}$").

It is typically unnecessary to explicitly construct `.StrMethodFormatter`
objects, as `~.Axis.set_major_formatter` also directly accepts the format
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
objects, as `~.Axis.set_major_formatter` also directly accepts the format
objects, as `~.Axis.set_major_formatter` directly accepts the format

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

Comment on lines +363 to +365
Negative numeric values will use a dash, not a Unicode minus; use mathtext
to get a Unicode minus by wrapping the format specifier with $ (e.g.
"${x}$").
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Negative numeric values will use a dash, not a Unicode minus; use mathtext
to get a Unicode minus by wrapping the format specifier with $ (e.g.
"${x}$").
Negative numeric values (e.g. -1) will use a dash, not a Unicode minus; use mathtext
to get a Unicode minus by wrapping the format specifier with $ (e.g.
"${x}$").

The negative numeric values alliteration threw me for the half sec & I think this is a minor enough add save the sleep deprived.

Also how does this interact w/ the Unicode minus RcParams?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Edited.
FormatStrFormatter doesn't interact with the unicode_minus rcParam, although it probably could...

dollar_ticks only uses FormatStrFormatter implicitly.
Comment on lines +363 to +365
Negative numeric values (e.g., -1) will use a dash, not a Unicode minus;
use mathtext to get a Unicode minus by wrapping the format specifier with $
(e.g. "${x}$").
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does this need to be here twice?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it applies both to FormatStrFormatter and to StrMethodFormatter. (Actually this may change with #27602...)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hate github code folding sometimes. :/

Comment on lines +363 to +365
Negative numeric values (e.g., -1) will use a dash, not a Unicode minus;
use mathtext to get a Unicode minus by wrapping the format specifier with $
(e.g. "${x}$").
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hate github code folding sometimes. :/

@story645 story645 modified the milestones: v3.8.3, v3.9.0 Jan 5, 2024
@story645 story645 merged commit d3892d5 into matplotlib:main Jan 5, 2024
@anntzer anntzer deleted the dt branch January 5, 2024 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Doc]: dollar_ticks example refers to unused formatter classes

2 participants